From: Florian Müllner Date: Wed, 19 Apr 2023 10:08:53 +0000 (+0200) Subject: popupMenu: Only activate items that still have the pointer X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~371^2^2~27 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=728a94dead7e12e35a0cfe47f63e14c763df0a56;p=gnome-shell.git popupMenu: Only activate items that still have the pointer After the introduction of implicit grabs in Clutter, a release event will now always be delivered to the actor that received the corresponding press event. This results in surprising behavior when moving the pointer while pressed, as a button release will always activate the original item, even when the pointer moved to a different item or outside the menu altogether. Address this by checking the hover state (that is, whether the item contains the pointer actor) before activating it. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6606 Part-of: --- diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 2f57c5831..c5fecc0ae 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -138,6 +138,11 @@ var PopupBaseMenuItem = GObject.registerClass({ return Clutter.EVENT_PROPAGATE; this.remove_style_pseudo_class('active'); + + // Pointer left the item during the grab + if (!this.hover) + return Clutter.EVENT_PROPAGATE; + this.activate(Clutter.get_current_event()); return Clutter.EVENT_STOP; }